Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

332
Visualizações
No "exports" main defined in C:\Users\node_modules\firebase\package.json

firebase config file.

here I am declaring my firebase configuration file, I am trying to initialize firebase firestore, database for one of my electron application, in the separate firebaseConfig.js file

const {initializeApp} = firebase;

const firebaseConfig = {
   setting all the configs here.. 

}

>here I am exporting the storage and db variables to be used in the main.js electron file where I have written a function to put the data to firebase

const storage = firebase.storage();
const db = firebase.firestore()
module.exports = storage;
module.exports = db;

main.js electron/node js file

below is the main.js file, where I am importing the variables that I have exported from the firebase config file

const storage = require('./firebase/firebaseconfig.js')
const db = require('./firebase/firebaseconfig.js');

function where firebase is being used, here I am supposed to use the storage and db variables that I have exported from the firebaseConfig file..

                    screenshot({format: 'png'})
                    .then((image)=>{
                        dns.lookup("www.google.com")
                        .then(()=>{
                           const uploadTask = storage.ref(`screenshots/${image.name}`).put(image);
                           uploadTask.on(
                               ()=>{
                                   storage
                                   .ref("screenshots")
                                   .child(image.name)
                                   .getDownloadURL()
                                   .then((url)=>{
                                    db.collection("screenshots").add({
                                        timestamp: firebase.firestore.FieldValue.serverTimestamp(),
                                        fieldName: image.name
                                    });
                                   })
                               } 
                           )
                        })
                        .catch(()=>{
                            fs.writeFile(path.join(myFolderPath, `new_screenshot_${counter}.png`),image, 
                            (err)=>{0
                                if(err){
                                    console.log(err)
                                }else{
                                    console.log('screenshot saved!');
                                    counter++;
                                }
                            });
                        })
                    })
                    .catch(err => console.log(err));
                }

now the problem is, with using firebase for node.js application.. I am being prompted with an error that states No "exports" main defined in C:\Users\screenshot_application\node_modules\firebase\package.json

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda